package com.TrainingCenter.service.transaction;

import com.TrainingCenter.dao.Dao;
import com.TrainingCenter.dao.impl.UserDaoImpl;
import com.TrainingCenter.entity.User;
import com.TrainingCenter.service.UserService;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ibook
 * Date: 12.05.14
 * Time: 22:39
 * To change this template use File | Settings | File Templates.
 */
public class TransactionUserService implements UserService {
    public TransactionUserService(Dao<User> userDao) {
        this.userDao = userDao;
    }

    private Dao<User> userDao;


    @Override
    public void add(User Persitent) {
      userDao.add(Persitent);
    }

    @Override
    public void edit(User Persitent) {
       userDao.edit(Persitent);
    }

    @Override
    public void delete(int id) {
      userDao.delete(id);
    }

    @Override
    public void delete(User Persitent) {
      userDao.delete(Persitent);
    }

    @Override
    public User get(int id) {
        return userDao.get(id);  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public List<User> getAllUser() {
        return userDao.getAllUser();  //To change body of implemented methods use File | Settings | File Templates.
    }

    public Dao<User> getUserDao() {
        return userDao;
    }


}

